#ifndef CONTACTSWINDOW_H
#define CONTACTSWINDOW_H

#include <QtGui>
#include <QtSql>
#include "contactsqlmodel.h"
#include "contactdelegate.h"
#include "contactform.h"
#include <QSqlTableModel>


#include "ui_contactswindow.h"

class QModelIndex;
class QItemDelegate;
class QDataWidgetMapper;

class ContactsWindow: public QMainWindow
{
    Q_OBJECT
public:
    ContactsWindow();

private:
    Ui::ContactsWindow ui;
    ContactSqlModel *model;
    int contactIdx;
    ContactDelegate *contactDelegate;
    ContactForm *form;
    QDataWidgetMapper *mapper;


 private slots:
    void on_deleteButton_clicked();
    void setCurrentIndex(const QModelIndex &index);
    void on_filterEdit_editingFinished();
    void on_clearButton_clicked();
    void contactActivated(const QModelIndex &index);
    void contactClosed();
};

#endif
